//1.引入相关vue文件
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/第七天作业/练习2/Home'
import My from '@/第七天作业/练习2/My'
import classify from '@/第七天作业/练习2/classify'
import Ranking from '@/第七天作业/练习2/Second/Ranking'
import Recommend from '@/第七天作业/练习2/Second/Recommend'
import SongList from '@/第七天作业/练习2/Second/SongList'
// 2.使用路由
Vue.use(VueRouter)

// 3.创建规则数组

const routes = [
    {
        path: '/',
        redirect: 'home',
    },
    {
        path: '/home',
        component:Home,
    },
    {
        path: '/my',
        component:My,
    },
    {
        path: '/classify',
        component: classify,
        redirect:'classify/ranking',
        children: [
            {
                path: 'ranking',
                component: Ranking
            },
            {
                path: 'recommend',
                component: Recommend
            },
            {
                path: 'songList',
                component: SongList
            },

        ]
    },
]

//4. 创建路由对象啊
const router = new VueRouter({
    routes,
})

// 5.导出路由
export default router



